package com.cheng.service.appinfo;

import com.cheng.dao.appinfo.AppInfoDao;
import com.cheng.pojo.AppInfo;
import com.cheng.utils.PageUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@SuppressWarnings("all")
public class AppInfoServiceImpl implements AppInfoService {
    @Autowired
    private AppInfoDao appInfoDao;

    @Override
    public void findAll(AppInfo appInfo, PageUtils pageUtils) {
        int count = appInfoDao.getCount(appInfo);
        pageUtils.setTotalCount(count);

        List<AppInfo> list = appInfoDao.getAll(appInfo, pageUtils);
        pageUtils.setList(list);
    }

    @Override
    public AppInfo getAppInfoById(AppInfo appInfo) {
        return appInfoDao.getAppinfoById(appInfo);
    }

    @Override
    public int updateStatus(AppInfo appInfo) {
        return appInfoDao.updateStatus(appInfo);
    }

    @Override
    public int addAppInfo(AppInfo appInfo) {
        return appInfoDao.addAppInfo(appInfo);
    }

    @Override
    public int isAppInfo(String apkName) {
        return appInfoDao.existApkName(apkName);
    }
}
